package gcontent.utils;

public class ConvertUtils {

	  private static final String HEXES = "0123456789ABCDEF";
	  
	  public static String getHexString(byte [] raw) {
		  StringBuilder hex;
		  
		  if ( raw == null )
			  return null;

		  hex = new StringBuilder( 2 * raw.length );
		  for ( final byte b : raw ) {
			  hex.append(HEXES.charAt((b & 0xF0) >> 4))
			  .append(HEXES.charAt((b & 0x0F)));
		  }
		  
		  return hex.toString();
	  }

}
